Repository navigation
aggregator(registry): reject non-string lastSeenAt/startedAt at the hygiene filter (#2376) - #3414
Merged
Merged
Conversation
…ygiene filter (#2376) isSessionRecord validated only id/source/label, so a record with a numeric/boolean lastSeenAt passed every entry filter and threw TypeError in mergeRecords string-only sort, taking down /sessions and /api/registry.json. The filter now requires lastSeenAt/startedAt to be string-or-absent (rejection, not coercion — the #2347 precedent), and parseLaunchRecords routes its output through the same filter so the launch path cannot inject a poisoned record either. Tests: new test/registry-hygiene-2376.test.ts covers poisoned records (numeric/boolean/object) via the store/feed filter path and the launch path, plus unchanged merge/sort behaviour for valid and timestamp-less records. Existing slice3 + registry-view suites stay green (46 pass total); tsc clean for the touched files.
|
Warning Review limit reachedYou've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository. Next included review available in 36 minutes. View limit details
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
This was referenced Nov 1, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #2376 (queue task 5253; follow-up of triage task 3537, CONFIRMED at main
0f4731ea0).Problem:
isSessionRecord(the registry hygiene filter) validated onlyid/source/label. A record with a present-but-non-stringlastSeenAtpassed every entry filter — durable store load (sources/live.ts:654), fleet feed registry section (:1088) — and the Claude launch path (parseLaunchRecords) bypassed the filter entirely. OncemergeRecords' string-only sort ((b.lastSeenAt ?? "").localeCompare(...)) compared such a record in the receiver position it threwTypeError, taking down/sessionsand/api/registry.json;mergeIntoRegistrypersists merged records, so a poisoned record was durably stored and the failure switched on later.Fix (owning layer, per the pinned triage):
isSessionRecordnow also requireslastSeenAtandstartedAtto be string-or-undefined — a present non-string timestamp rejects the record (no coercion; the aggregator(comments+actions): a store record that passes the load filter but lacks a string createdAt crashes every comments/actions read — and persist() re-writes it forever #2347 load-filter precedent).parseLaunchRecordsroutesrecordFromLaunchoutput throughisSessionRecord, so launch records get the same validation.Tests: new
pm-stack/aggregator/test/registry-hygiene-2376.test.ts—lastSeenAtand numeric/booleanstartedAt, accepts string/absent;lastSeenAtor numericstartedAtdropped, valid/timestamp-less records kept;lastSeenAtmerge exactly as before.Verified on the laptop: new file 6/6 pass; existing
slice3+registry-viewsuites 40/40 pass;tsc --noEmitclean for the touched files (pre-existing unrelated errors intest/charges-collect.test.tsexist on clean main).Need help on this PR? Tag
@codesmith-botwith what you need.